/*
package com.mty.controller;

import com.mty.entity.Order;
import com.mty.entity.Product;
import com.mty.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

*/
/**
 * @author ：Teacher马（2508531326@qq.com）
 * @date ：Created in 2022/11/18 16:49
 * @description：
 * @modified By：
 * @version:
 *//*

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private OrderService orderService;

    @GetMapping("/saveOrder")
    public String saveOrder(Long pid,Integer num){
        Order order=new Order();
        order.setUid(1);
        order.setUsername("黑白无常");
        order.setPid(pid);
        Product product = restTemplate.getForObject("http://shop-product/product/getById/"+pid, Product.class);
        order.setPname(product.getPname());
        order.setPprice(product.getPprice());
        order.setNumber(num);
        orderService.save(order);
        return "成功";
    }
}
*/
